# coding:utf-8

import tensorflow as tf
import numpy as np

# 创建数据
matrix1 = tf.constant([[3, 3]])
matrix2 = tf.constant([[2], [2]])
product = tf.matmul(matrix1, matrix2)

# 方法1
sess = tf.Session()
result = sess.run(product)
print(result)
sess.close()

# 方法2(运行到最后会自动关闭会话)
with tf.Session() as sess:
    result = sess.run(product)
    print(result)
